<template>
  <el-config-provider :locale="zhCn">
    <router-view/>
  </el-config-provider>
</template>

<script setup lang="ts">
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import {getDarkColor, getLightColor} from "@/utils/color";

//必须传16进制色值
const theme = reactive({
  primary: '#366EF4'
})
// 计算主题颜色变化
document.documentElement.style.setProperty("--el-color-primary", theme.primary);
document.documentElement.style.setProperty(
    "--el-color-primary-dark-2", `${getDarkColor(theme.primary, 0.3)}`
);
for (let i = 1; i <= 9; i++) {
  const primaryColor = `${getLightColor(theme.primary, i / 10)}`
  document.documentElement.style.setProperty(`--el-color-primary-light-${i}`, primaryColor);
}
</script>

<style lang="scss">
:root{
  min-width: 1024px;
  overflow-x: auto;
  overflow-y: hidden;
}
</style>
